#ifndef WF_INFOAREA_H
#define WF_INFOAREA_H

#include "pf_previewactioninterface.h"
#include "pf_infoarea.h"
#include "gui_export.h"

/**
 * This action class can handle user events to measure distances between 
 * two points.
 *
 */
class GUI_EXPORT WF_InfoArea : public PF_PreviewActionInterface {
	Q_OBJECT
public:
    /**
     * Action States.
     */
    enum Status {
        SetFirstPoint,    /**< Setting the 1st point of the polygon. */
        SetNextPoint      /**< Setting a next point. */
    };

public:
    WF_InfoArea(PF_Container& container,
                        PF_GraphicView& graphicView);
    ~WF_InfoArea() {}

	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);

    virtual void init(int status=0);
    virtual void trigger();

    virtual void mouseMoveEvent(PF_MouseEvent* e);
    virtual void mouseReleaseEvent(PF_MouseEvent* e);
	
	virtual void coordinateEvent(PF_CoordinateEvent* e);
	
    virtual void updateMouseButtonHints();
    virtual void updateMouseCursor();
    virtual void updateToolBar();

private:
    PF_Vector point1;
    PF_Vector prev;
	PF_Entity* currentLine;
	PF_Entity* closingLine;
    //PF_Vector point2;
	PF_InfoArea ia;
};

#endif
